﻿namespace TC
{
    public class StringConvert : VariableNode
    {
        public ValueInput<string> valueIn;
        public ValueOutput<int> intOut;
        public ValueOutput<double> doubleOut;
        public ValueOutput<float> floatOut;

        public override void OnCreate()
        {
            base.OnCreate();

            valueIn = this.AddValueInPort<string>("valueIn");
            intOut = this.AddValueOutPort<int>("intOut", () => { return int.Parse(valueIn.Value); });
            doubleOut = this.AddValueOutPort<double>("doubleOut", () => { return double.Parse(valueIn.Value); });
            floatOut = this.AddValueOutPort<float>("floatOut", () => { return float.Parse(valueIn.Value); });
        }
    }
}
